package net.zjitc.myTree;

/**
 * Created by Administrator on 2017/4/27.
 */
public class TreeNode<E> {
    private E data; //数据本身
    private TreeNode<E> lChild; //左子树
    private TreeNode<E> rChild; //右子树

    public TreeNode() {
    }

    public TreeNode(E data, TreeNode<E> lChild, TreeNode<E> rChild) {
        this.data = data;
        this.lChild = lChild;
        this.rChild = rChild;
    }

    public TreeNode(E data) {
        this.data = data;
        this.lChild = null;
        this.rChild = null;
    }

    /*针对当前的结点进行查找或更改*/
    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }

    public TreeNode<E> getlChild() {
        return lChild;
    }

    public void setlChild(TreeNode<E> lChild) {
        this.lChild = lChild;
    }

    public TreeNode<E> getrChild() {
        return rChild;
    }

    public void setrChild(TreeNode<E> rChild) {
        this.rChild = rChild;
    }

}
